{#
  Renders an author info snippet.
  If there's no data for the author, just renders their ID. This isn't ideal but is better than
  crashing.
#}
{% macro postAuthor(authorId, locale) %}

{% set author = postsData.authors[authorId] %}

<div class="display-flex align-start">
  {% if author.image %}
    <a href="{{ author.url }}" class="card-authors__image">
      {% Img
        class="flex-shrink-none width-600 height-600",
        src=author.image,
        alt=author.title | i18n(locale),
        width="40",
        height="40",
        options={minWidth: 40, maxWidth: 120}
      %}
    </a>
  {% endif %}
  <div class="display-flex direction-column align-start gap-left-300 type--small">
    {% if author %}
      <a href="{{ author.url }}" class="surface display-inline-flex color-text">{{ author.title | i18n(locale) }}</a>
      <p class="color-secondary-text">{{ author.description | i18n(locale) }}</p>
    {% else %}
      <p>{{ authorId }}</p>
    {% endif %}
  </div>
</div>

{% endmacro %}
